
<%@ page pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<div >
	<div>选择类型</div>
	<select onchange="selectType()" id="drpType">
		<option value="incident">事件管理</option>
		<option value="problem">问题管理</option>
		<!-- <option value="change">变更管理</option>
		<option value="release">发布管理</option> -->
	</select>
</div>
<div id="tb_incident">
	<table class="form-table">
		<tr>
			<td colspan="4"><div class="header">
					<h3>更新事件时间</h3>
				</div>
			</td>
		</tr>

		<tr>
			<td class="td1">事件编号：</td>
			<td class="td2" colspan="3"><input type="text" id="code"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">创建时间：</td>
			<td class="td2" colspan="3"><input id="createTime"
				name="createTime" type="datetime"  class="required">
			</td>
		</tr>
		<tr style="display:none">
			<td class="td1">关闭时间：</td>
			<td class="td2" colspan="3"><input type="text" id="closeTime"
				class="required">
			</td>
		</tr>
		<div style="display:none">
			<tr style="display:none">
				<td class="td1">响应时间：</td>
				<td class="td2" colspan="3"><input type="text"
					id="responseTime">
				</td>
			</tr>
			<tr style="display:none">
				<td class="td1">到场时间：</td>
				<td class="td2" colspan="3"><input type="text" id="arriveTime">
				</td>
			</tr>
			<tr style="display:none">
				<td class="td1">解决时间：</td>
				<td class="td2" colspan="3"><input type="text" id="solveTime"
					class="required">
				</td>
			</tr>

		</div>
	</table>

</div>

<div id="tb_problem" style="display:none">
	<table class="form-table">
		<tr>
			<td colspan="4"><div class="header">
					<h3>更新问题时间</h3>
				</div>
			</td>
		</tr>

		<tr>
			<td class="td1">编号：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_code"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">开始日期：</td>
			<td class="td2" colspan="3"><input type="text"
				id="pr_createTime" class="required">
			</td>
		</tr>
		<!-- <tr>
			<td class="td1">分派日期：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_fenpai"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">问题分析日期：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_analyz"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">实施完成日期：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_finish"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">跟踪开始日期：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_bg"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">跟踪结束日期：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_end"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">关闭时间：</td>
			<td class="td2" colspan="3"><input type="text" id="pr_closeTime"
				class="required">
			</td>
		</tr> -->
	</table>

</div>

<div id="tb_change" style="display:none">
	<table class="form-table">
		<tr>
			<td colspan="4"><div class="header">
					<h3>更新变更时间</h3>
				</div>
			</td>
		</tr>

		<tr>
			<td class="td1">编号：</td>
			<td class="td2" colspan="3"><input type="text" id="chg_code"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">请求日期：</td>
			<td class="td2" colspan="3"><input type="text"
				id="chg_createTime" class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">计划开始日期：</td>
			<td class="td2" colspan="3"><input type="text" id="chg_bg"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">计划结束日期：</td>
			<td class="td2" colspan="3"><input type="text" id="chg_end"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">审批时间：</td>
			<td class="td2" colspan="3"><input type="text" id="chg_shenhe"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">实施完成时间：</td>
			<td class="td2" colspan="3"><input type="text" id="chg_finish"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">关闭时间：</td>
			<td class="td2" colspan="3"><input type="text" id="chg_close"
				class="required">
			</td>
		</tr>
	</table>

</div>

<div id="tb_release" style="display:none">
	<table class="form-table">
		<tr>
			<td colspan="4"><div class="header">
					<h3>更新发布时间</h3>
				</div>
			</td>
		</tr>

		<tr>
			<td class="td1">编号：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_code"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">请求日期：</td>
			<td class="td2" colspan="3"><input type="text"
				id="rls_createTime" class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">计划开始日期：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_bg"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">计划结束日期：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_end"
				class="required">
			</td>
		</tr>


		<tr>
			<td class="td1">审批时间：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_shenhe"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">实施完成时间：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_finish"
				class="required">
			</td>
		</tr>

		<tr>
			<td class="td1">测试开始日期：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_testbg"
				class="required">
			</td>
		</tr>
		<tr>
			<td class="td1">测试结束日期：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_testend"
				class="required">
			</td>
		</tr>


		<tr>
			<td class="td1">关闭时间：</td>
			<td class="td2" colspan="3"><input type="text" id="rls_close"
				class="required">
			</td>
		</tr>
	</table>

</div>

<div>
	<input type="button" value="提交" onclick="save()">
</div>

<div>
	<table class="form-table">
		<tr>
			<td colspan="4"><div class="header">
					<h3>批量发起事件单流程</h3>
				</div></td>
		</tr>
		
		<tr>
			<td class="td1">tableName：</td>
			<td class="td2" colspan="3"><input type="text"
				id="nxTableName" class="">
			</td>
		</tr>
		
		<tr>
			<td class="td1">processKey：</td>
			<td class="td2" colspan="3"><input type="text"
				id="nxProcessKey" class="">
			</td>
		</tr>


		<tr>
			<td class="td1">nextTaskId：</td>
			<td class="td2" colspan="3"><input type="text"
				id="nx-nextTaskId" class="">
			</td>
		</tr>
		<tr>
			<td class="td1">nextTransitionId：</td>
			<td class="td2" colspan="3"><input type="text"
				id="nx-nextTransitionId" class="">
			</td>
		</tr>
		<tr>
			<td class="td1">status：</td>
			<td class="td2" colspan="3"><input type="text" id="nx-status"
				class="">
			</td>
		</tr>
		<tr>
			<td class="td1">nx-col：</td>
			<td class="td2" colspan="3"><input type="text" id="nx-col" value="supporter_id"
				class="">
			</td>
		</tr>
		<tr>
			<td colspan="4"><input type="button" value="发起事件单"
				onclick="takeUpProcess()"/> 
				
				<input type="button" value="发起问题单"
				onclick="takeUpProbProcess()"/>
				
				<input type="button"
				value="进入下一步" onclick="gtnext()"/></td>
		</tr>

	</table>

</div>


<script type="text/javascript">
	function takeUpProcess() {
		 $.ajax({
			url : "incident/incident/startUpProcess", //请求的url地址
			data : {}, //参数值
			type : "GET", //请求方式
			success : function(date) {
				alert(date);
			},
			error : function() {
				alert("no-ok！");
			}
		}); 
	}
	
	function takeUpProbProcess() {
		 $.ajax({
			url : "incident/incident/startUpProbProcess", //请求的url地址
			data : {}, //参数值
			type : "GET", //请求方式
			success : function(date) {
				alert(date);
			},
			error : function() {
				alert("no-ok！");
			}
		}); 
	}
	function gtnext()
	{
	   var nextTaskId=$("#nx-nextTaskId").val();
	   var nextTransitionId=$("#nx-nextTransitionId").val();
	   var nxstatus=$("#nx-status").val();
	   var handlColumns=$("#nx-col").val();
	   var nxTableName=$("#nxTableName").val();
	   var nxProcessKey=$("#nxProcessKey").val();
	   $.ajax({
			url : "incident/incident/gtnext", //请求的url地址
			data : {tableName:nxTableName,processKey:nxProcessKey,nextTaskId:nextTaskId,nextTransitionId:nextTransitionId,status:nxstatus,handColumn:handlColumns}, //参数值
			type : "GET", //请求方式
			success : function(date) {
				alert(date);
			},
			error : function() {
				alert("no-ok！");
			}
		});
	}

	function selectType() {
		var v = $("#drpType").val();
		$("[id^='tb_']").hide();

		$("#tb_" + v).show();
	}

	function save() {
		var v = $("#drpType").val();

		switch (v) {
		case "incident":
			var code = $("#code").val();
			var createTime = $("#createTime").val();
			var responseTime = $("#responseTime").val();
			var arriveTime = $("#arriveTime").val();
			var solveTime = $("#solveTime").val();
			var closeTime = $("#closeTime").val();

			$.ajax({
				url : "incident/incident/doUpdateicdTime", //请求的url地址
				data : {
					"code" : code,
					"createTime" : createTime,
					"responseTime" : responseTime,
					"arriveTime" : arriveTime,
					"solveTime" : solveTime,
					"closeTime" : closeTime
				}, //参数值
				success : function(d) {
					alert(d);
				},
				error : function() {
					alert("失败！");
				}
			});
			break;
		case "problem":

			var pr_code = $("#pr_code").val();
			var pr_createTime = $("#pr_createTime").val();

			$.ajax({
				url : "problem/problem/doUpdateTime", //请求的url地址
				data : {
					"pr_code" : pr_code,
					"pr_createTime" : pr_createTime
				}, //参数值
				success : function(date) {
					alert("成功！");
				},
				error : function() {
					alert("失败！");
				}
			});
			break;
		case "change":

			var chg_code = $("#chg_code").val();
			var chg_createTime = $("#chg_createTime").val();
			var chg_shenhe = $("#chg_shenhe").val();
			var chg_finish = $("#chg_finish").val();
			var chg_bg = $("#chg_bg").val();
			var chg_end = $("#chg_end").val();
			var chg_close = $("#chg_close").val();

			$.ajax({
				url : "change/change/doUpdateTime", //请求的url地址
				dataType : "json", //返回格式为json
				data : {
					"chg_code" : chg_code,
					"chg_createTime" : chg_createTime,
					"chg_finish" : chg_finish,
					"chg_bg" : chg_bg,
					"chg_end" : chg_end,
					"chg_close" : chg_close,
					"chg_shenhe" : chg_shenhe
				}, //参数值
				type : "GET", //请求方式
				success : function(date) {
					alert("成功！");
				},
				error : function() {
					alert("成功！");
				}
			});
			break;
		case "release":

			var rls_code = $("#rls_code").val();
			var rls_createTime = $("#rls_createTime").val();
			var rls_bg = $("#rls_bg").val();
			var rls_end = $("#rls_end").val();
			var rls_shenhe = $("#rls_shenhe").val();
			var rls_finish = $("#rls_finish").val();
			var rls_testbg = $("#rls_testbg").val();
			var rls_testend = $("#rls_testend").val();
			var rls_close = $("#rls_close").val();

			$.ajax({
				url : "release/release/doUpdateTime", //请求的url地址
				dataType : "json", //返回格式为json
				data : {
					"rls_code" : rls_code,
					"rls_createTime" : rls_createTime,
					"rls_bg" : rls_bg,
					"rls_end" : rls_end,
					"rls_shenhe" : rls_shenhe,
					"rls_finish" : rls_finish,
					"rls_testbg" : rls_testbg,
					"rls_testend" : rls_testend,
					"rls_close" : rls_close
				}, //参数值
				type : "GET", //请求方式
				success : function(date) {
					alert("成功！");
				},
				error : function() {
					alert("成功！");
				}
			});
			break;

		}

	}
</script>

